package com.tanhua.autoconfig;

import com.tanhua.autoconfig.properties.FaceProperties;
import com.tanhua.autoconfig.properties.HuanXinProperties;
import com.tanhua.autoconfig.properties.OssProperties;
import com.tanhua.autoconfig.properties.TXSMSProperties;
import com.tanhua.autoconfig.template.FaceTemplate;
import com.tanhua.autoconfig.template.HuanXinTemplate;
import com.tanhua.autoconfig.template.OssTemplate;
import com.tanhua.autoconfig.template.TXSMSTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(value = {TXSMSProperties.class,OssProperties.class,FaceProperties.class, HuanXinProperties.class})
public class TanhuaAutoConfiguration {

    @Bean
    public TXSMSTemplate txsmsTemplate(TXSMSProperties txsmsProperties){
        return new TXSMSTemplate(txsmsProperties);
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties ossProperties){
        return new OssTemplate(ossProperties);
    }
    @Bean
    public FaceTemplate faceTemplate(FaceProperties faceProperties){
        return new FaceTemplate(faceProperties);
    }

    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties properties) {
        return new HuanXinTemplate(properties);
    }
}
